% TEST_ID: LANG-EXPAND-0069
% CATEGORY: language/convert
% 测试 cast 函数

function test_num_cast
    assert(isequal(cast([97, 98; 99.2, -129], 'int8'), [97, 98; 99, -128]));
    assert(isequal(cast([97, 98; 99, 100], 'char'), ['a', 'b'; 'c', 'd']));
    assert(isequal(cast([97, 98; 256.5, -129], 'uint8'), [97, 98; 255, 0]));
    assert(isequal(cast([97, 98; 99.2, -129], 'like', int8(1)), [97, 98; 99, -128]));
    assert(isequal(class(cat(1, 1, int32(1))), 'int32'))
    assert(isequal(class(horzcat(1, int32(1))), 'int32'))
end